#include "led.h"

#define PIOB_BASE (0xFFFFF600)
#define PIOB_PER  (volatile unsigned int*)(PIOB_BASE + 0x00)
#define PIOB_OER  (volatile unsigned int*)(PIOB_BASE + 0x10)
#define PIOB_SODR (volatile unsigned int*)(PIOB_BASE + 0x30)
#define PIOB_CODR (volatile unsigned int*)(PIOB_BASE + 0x34)

// E/A-Leitung, an welcher die gelbe LED angeschlossen ist
#define YELLOW_LED_BIT (1 << 27)

void init_yellow_led()
{
  *PIOB_PER = YELLOW_LED_BIT;
  *PIOB_OER = YELLOW_LED_BIT;
}
//------------------------------------------------------------------------------
void switch_yellow_led_on()
{
  *PIOB_SODR = YELLOW_LED_BIT;
}
//------------------------------------------------------------------------------
void switch_yellow_led_off()
{
  *PIOB_CODR = YELLOW_LED_BIT;
}
//------------------------------------------------------------------------------

